<#include "/common/head.html"/> 
<table id="dg"></table>
<div id="tb" style="padding:2px 5px;">
	   <!--         动态获取的商户名称 -->
   	    <div class="wrap_input">${shop.name!''}
   	   		<input type="hidden" value="${shop.id!''}" id="id"></input>
   	   		<input type="hidden" value="${shop.searchNumber!''}" id="searchNumber"></input>
   	   		<input type="hidden" value="${shop.balance!''}" id="balance"></input>
   	   		<input type="hidden" value="${shop.name!''}" id="name"></input>
   	   		<a href="javascript:void(0)" class="easyui-linkbutton addBtn" iconCls="glyphicon-search" plain="true" onclick="recharge()">充值</a>
   	   		<a href="javascript:void(0)" class="easyui-linkbutton addBtn" iconCls="glyphicon-search" plain="true" onclick="consume()">消费记录</a>
   	   		<a href="javascript:void(0)" class="easyui-linkbutton addBtn" iconCls="glyphicon-plus" plain="true" onclick="add()">产品价格配置</a>
   	    </div>
   	    
   	    <tr></tr>
        <div>
        	<tr>
        		<td>
        			已开通服务：<span id="service"></span>
        			<input type="hidden" value="${shop.serviceId!''}" id="serviceId">
        			<span id="">${shop.serviceId!''}</span>
        		</td>
<!--         		<td> -->
<!--         			未开通服务： <span id="noService"></span> -->
<!--         			<input  type="hidden" value="${shop.serviceId!''}" id="ruleSetId2"></input> -->
						
<!--         		</td> -->
        	</tr>
        </div>
       	<div>
       		<table>
       			<tr>
       				<td width="100px">可用余额 </td>
       				<td>${shop.balance!''}</td>
       			</tr>
       			<tr>
       				<td>已查询条数</td>
       				<td>${shop.searchNumber!''}</td>
       			</tr>
       			<tr>
       				<td>规则集名称</td>
       				<td>${shop.username!''}
       				<input type="hidden" value="${shop.remarks!''}" id="shopSet_id">
	       				<a href="javascript:void(0)" class="easyui-linkbutton addBtn" iconCls="glyphicon-edit" plain="true" onclick="searchRule()">查看</a>
       				</td>
       				
       			</tr>
       		</table>
       	</div>
    </div>
<script type="text/javascript">
var datagrid = $("#dg");
var id=$("#id").val();
var searchNumber=$("#searchNumber").val();
var balance=$("#balance").val();
var name=$("#name").val();
var username=$("#username").val();
//var id=$("#id").val();
/* var dgOptions = {
        rownumbers:true,
    	fit:true,
    	border:false,
    	striped:true,
        rownumbers:true,
    	url:'detailpage?id='+id,
    	method:'post',
    	toolbar:'#tb',
    	pageSize:50,
    	pagination:true,
    	multiSort:true,
    	singleSelect:true,
//         queryParams: getInitParam(),
        columns: [[
			
		         {field:'type',title: '充值方式', width:100,formatter:formatPayType }
	           	 ,{field:'money', title: '充值金额', width:100 }
	           	,{field:'createTime', title: '充值时间', width:150 } 
	       
	           ]]
	}; */
$(function() {
	datagrid.datagrid(dgOptions);
});

function detailpage() {
	location.replace('detailpage');
}
function update() {
	var rowsSel = datagrid.datagrid("getSelections");
	if(rowsSel.length != 1) {
		showWarnMsg("请选择一条数据！");
		return;
	}
	var activityid = rowsSel[0].activityid;
	location.replace('updatePage?activityid='+activityid);
}

function cancelAudit() {
	var rowsSel = datagrid.datagrid("getSelections");
 	if(rowsSel.length != 1) {
		showWarnMsg("请选择一条数据！");
		return;
	} 
 	var activityid = rowsSel[0].activityid;
	location.replace('adcurationPage?activityid='+activityid);
}

//var s_time = 0;
function zcurdSearch() {
	var param = zcurdGetParam();
	//if(s_time==0){
	//	datagrid.datagrid(dgOptions);
	//	s_time++;
	//}else{
		datagrid.datagrid("load", param);
	//}
}

function zcurdGetParam() {
	var param = {};
	$("#tb :input[name]").each(function(i, item) {
		if($(item).val()) {
			param[$(item).attr("name")] = $(item).val().trim();	
		}
	});
	return param;
}

function formatPayType(value,row,index){
	//支付方式,0 省平台支付1 话费支付2 网银支付3 嗖付支付4 电子券支付5手机支付全网
	if(value == '0'){
		return "现金";
	}
	if(value == '1'){
		return "刷卡";
	}
	if(value == '2'){
		return "支付宝";
	}
	if(value == '3'){
		return "微信";
	}
}
function formatPayType2(value,row,index){

	if (row.type=='0') {
		if(value == '1'){
			return "反欺诈";
		}
		if(value == '2'){
			return "评分卡";
		}
	}
	
	if (row.type=='1') {
		if(value == '0'){
			return "权限管理";
		}
		if(value == '1'){
			return "订单管理";
		}
		if(value == '2'){
			return "管理员";
		}
	}
	
}
//产品价格配置
function add(){
	location.replace("allocation?id="+id+"&name="+name+"&balance="+balance+"&searchNumber="+searchNumber+"&setId="+$("#shopSet_id").val());
}

//充值记录
function recharge(){
	location.replace("recharge?id="+id+"&name="+name+"&balance="+balance+"&searchNumber="+searchNumber);
}
//消费记录
function consume(){
	location.replace("consume?id="+id+"&name="+name+"&balance="+balance+"&searchNumber="+searchNumber);
}
//查看规则集
function searchRule(){
	location.replace("search?id="+id+"&name="+name+"&balance="+balance+"&searchNumber="+searchNumber+"&setId="+$("#shopSet_id").val());
}

</script>
<#include "/common/dialogWindow.html"/>
<#include "/common/foot.html"/>